(Etch folder reinforcing bar - rounding over edges - example program 3)
(20th January 2014)
(MEW)
(for Mach3)
()
(Rounds the top edge of the periphery)
()
()
(Set X0 Y0 in the centre of the work, midway between the two securing pins)
(Set Z0 at the top surface of the work)
(Safe Z is clear of the work and all obstacles at Z20. Adjust as necessary if you are using a different setup to the one shown in MEW)
()
(Tool is a 2mm radius corner rounding end mill)
(Body diameter is 10mm, giving 3mm offset between vertical axis -CP- and inner edge of cutter)
(Set up same as a 6mm diameter end mill)
(Depth of cut 2mm)
()
(Program sets speed to 3000rpm, for a 10mm cutter machining aluminium)
(Feed rate 100mm/min because of length of cutting edge in contact with work)
()
()
(------------------ Main Program ---------------)
()
()
(Initialisation sequence)
G17 (use the XY plane)
G21 (Set the units to mm)
G40 (Cancel cutter compensation)
G49 (Cancel tool length offsets)
G54 (Use co-ordinate system 1)
G61 (Exact path mode)
G80 (cancel canned cycle mode)
G90 (Use absolute distances)
G91.1 (Use incremental distances for arcs)
G92.1 (Cancel co-ordinate system offsets)
G94 (Set feed per minute mode)
G98 (Set the canned cycle retract behaviour)
()
#41=0 (Parameter 41 stores the current Z value)
()
S3000
M3
F100
()
G0 Z20 (Safe Z)
()
(Prepare to cut periphery oversize)
G0 X-54.6 Y-19.1
#41=0
G0 Z#41
M98 P118 L4 (Cuts to 1.9mm deep and 0.1mm larger in X and Y than final size)
G0 Z10 (Safe Z)
()
(Prepare to cut periphery to final size using a climbing cut)
G0  X-54.5 Y-19 
#41=-2
G0 Z0
M98 P116 L1
G0 Z20
G0 X0 Y0
M5
M30
()
()
(------------ Subroutine definitions follow ----------------)
()
()
O116 (Subroutine to cut periphery to final size)
G1 Z#41 (Make the Z height the same as the number in parameter 41)
G3 X-54.5 Y-13 I0 J3
G2 X-60.5 Y-7 I0 J6
G1 X-60.5 Y7
G2 X-54.5 Y13 I6 J0
G1 X54.5 Y13
G2 X60.5 Y7 I0 J-6
G1 X60.5 Y-7
G2 X54.5 Y-13 I-6 J0
G1 X-54.5 Y-13
G3 X-54.5 Y-19 I0 J-3
M99
()
O118 (Subroutine to cut periphery 0.1mm oversize) 
#41=[#41-0.475] (Make the contents of parameter 41 0.475 less)
(Subtracts 0.475 each time because 4 times 0.475 = 1.9)
G0 Z#41     (Make the Z height the same as the number in parameter 41)
G2 X-54.5 Y-13.1 I0 J3
G1 X54.5 Y-13.1
G3 X60.6 Y-7 I0 J6.1
G1 X60.6 Y7
G3 X54.5 Y13.1 I-6.1 J0
G1 X-54.5 Y13.1
G3 X-60.6 Y7 I0 J-6.1
G1 X-60.6 Y-7
G3 X-54.5 Y-13.1 I6.1 J0
G2 X-54.5 Y-19.1 I0 J-3
M99
